package com.cdks.wuxiu.api.service.mysql;


import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cdks.wuxiu.api.mapper.BannedUserInfoMapper;
import com.cdks.wuxiu.entity.mysql.BannedUserInfo;
import java.util.List;

import org.springframework.stereotype.Service;


/**
 * 封号信息表 服务实现类
 */
@Service
public class BannedUserInfoServiceImpl extends ServiceImpl<BannedUserInfoMapper, BannedUserInfo> implements BannedUserInfoService {

    @Override
    public List<BannedUserInfo> getList(long userId, String udid, String phone, String ip) {
        return baseMapper.getList(userId, udid, phone, ip);
    }

    @Override
    public int updateInfoById(BannedUserInfo bannedInfo) {
        UpdateWrapper<BannedUserInfo> wrapper = new UpdateWrapper<>();
        wrapper.lambda().eq(BannedUserInfo::getId, bannedInfo.getId());

        int ret  = baseMapper.update(bannedInfo, wrapper);
        if (ret == 1)
        {
            return 0;
        }

        return -1;
    }
}
